import React from 'react';
import { Route, Redirect, IndexRoute } from 'react-router';

import App from 'container/App';
import EmployeeListContainer from 'container/EmployeeListContainer';
import SimpleListContainer from 'container/SimpleListContainer';
import CreateImployeePage from 'container/CreateEmployeePage';
import UploadPage from 'container/UploadPage';
import PrivatePage from 'container/PrivatePage';
import LoginPage from 'container/LoginPage';
import privateRoute from 'router/privateRoute';

export default (onLogout) => (
  <Route path="/" name="app" component={App}>
    <IndexRoute component={SimpleListContainer}/>
    <Route path="employees" component={EmployeeListContainer}/>
    <Route path="createEmployee" component={CreateImployeePage}/>
    <Route path="private" component={privateRoute(PrivatePage)}/>
    <Route path="upload" component={UploadPage}/>
    <Route path="login" component={LoginPage}/>
    <Route path="logout" onEnter={onLogout}/>
  </Route>
);
